package com.mycode.util;

import com.mycode.model.Account;

import java.io.*;

/**
 * @author shkstart
 * @create 2021-01-22 17:37
 */
public class FileUtil {
    //通道
    private static FileInputStream fin;
    private static FileOutputStream fout;
    private static ObjectInputStream objIn;
    private static ObjectOutputStream objOt;
    private static File accFile = null;

    private static final int INIT_BANK_NO = 1000;

    /**
     *
     * 初始化
     *
     * */
    static {
        //初始化文件信息
        //默认账号从1000开始，后续新用户账号为最后一个用户账号+1
        //定义保存文件的目录
        File dir = new File("accFile");
        if (!dir.exists()) {
            dir.mkdirs();
        }
        accFile = new File("accs.acc");
        try {
            accFile.createNewFile();
        } catch (IOException e) {
            e.printStackTrace();
        }

    }

    /*
     * 添加用户
     *
     *
     * */
    public static void addAcc(Account acc) {

    }

}
